package com.tancire.web.controller.app;

import com.tancire.common.core.controller.BaseController;
import com.tancire.common.core.domain.AjaxResult;
import com.tancire.common.core.page.TableDataInfo;
import com.tancire.works.domain.SideWork;
import com.tancire.works.service.ISideWorkService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * 兼职管理Controller
 *
 * @author tancire
 * @date 2024-02-27
 */
@RestController
@RequestMapping("/net/app/works")
public class SideWorkAppController extends BaseController {
    @Resource
    private ISideWorkService sideWorkService;

    /**
     * 查询兼职管理列表
     */
    @GetMapping("/list")
    public TableDataInfo list(SideWork sideWork) {
        startPage();
        List<SideWork> list = sideWorkService.selectSideWorkList(sideWork);
        return getDataTable(list);
    }

    /**
     * 获取兼职管理详细信息
     */
    @GetMapping(value = "/detail/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id) {
        return AjaxResult.success(sideWorkService.selectSideWorkById(id));
    }


}
